package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {

    /**
     * 查询所有用户
     */
    @Select("select * from user")
    List<User> findAll();

    /**
     *根据id寻找用户
     */
    @Select("select * from user where id=#{id}")
    User findById(Integer id);

    /**
     *修改用户信息
     */
    @Select("update user set age=#{age},username=#{username},PASSWORD=#{PASSWORD},email=#{email},sex=#{sex} where id=#{id}")
    void update(User user);
}
